The CxGnsDbEditor object contains the following methods:
The Connect method connects to a GNS.
Connect(DomainSiteService As String)
| Parameter | Required | Description |
|---|---|---|
|
DomainSiteService |
Yes |
The [Domain]Site.Service to which to connect. A domain is optional. The service must be a valid GNS. |
Example
The following example creates and connects the CxGnsDbEditor object.
|
Sub Dim GnsDbEditor Set GnsDbEditor = CreateObject("CxEditors.CxGnsDbEditor") GnsDbEditor.Connect("[5410]CYGDEMO.GNS") End Sub |
The Copy method launches a New GNS Entry property sheet initialized with the information in the specified record.
Copy(QueueKey As String) As Integer
| Parameter | Required | Description |
|---|---|---|
|
QueueKey |
Yes |
The database queue key of the record to copy. |
This method returns one of the following values:
| -1 or 0 | An error occurred. | |
|
1 |
OK button was pressed. | |
| 2 | Cancel button was pressed. |
Example
The following example launches a New GNS Entry property sheet for record "MYRECORD."
|
Sub Dim iKey iKey = GnsDbEditor.Find("MYRECORD") Dim iRet iRet= GnsDbEditor.Copy(iKey) MsgBox iRet End Sub |
The Delete method launches a Delete GNS Entry property sheet initialized with the information in the specified record.
Delete(QueueKey As String) As Integer
| Parameter | Required | Description |
|---|---|---|
|
QueueKey |
Yes |
The database queue key of the record to delete. |
This method returns one of the following values:
| -1 or 0 | An error occurred. | |
|
1 |
OK button was pressed. | |
| 2 | Cancel button was pressed. |
Example
The following example launches a Delete GNS Entry property sheet for record "MYRECORD."
|
Sub Dim iKey iKey = GnsDbEditor.Find("MYRECORD")
Dim iRet iRet= GnsDbEditor.Delete(iKey) MsgBox iRet End Sub |
The Disconnect method disconnects from the connected GNS service.
Disconnect()
Example
The following example disconnects the GnsDbEditor object.
|
Sub GnsDbEditor.Disconnect End Sub |
The Edit method launches a property sheet for the specified record.
Edit(QueueKey As String) As Integer
| Parameter | Required | Description |
|---|---|---|
|
QueueKey |
Yes |
The database queue key of the record to edit. |
This method returns one of the following values:
| -1 or 0 | An error occurred. | |
|
1 |
OK button was pressed. | |
| 2 | Cancel button was pressed. |
Example
The following example launches a property sheet for record "MYRECORD."
|
Sub Dim iKey iKey = GnsDbEditor.Find("MYRECORD")
Dim iRet iRet= GnsDbEditor.Edit(iKey) MsgBox iRet End Sub |
The Find method returns the database queue key for the specified GNS ID.
Find(GnsId As String) As Integer
| Parameter | Required | Description |
|---|---|---|
|
GnsId |
Yes |
The GNS ID for which to retrieve a database queue key. |
This method returns an error if the GNS ID is not found in the connected GNS service.
Example
The following example displays the database queue key for the record with ID "MYRECORD."
|
Sub Dim iRet iRet= GnsDbEditor.Find("MYRECORD") MsgBox iRet End Sub |
The New method launches a New GNS Entry property sheet.
New() As Integer
This method returns one of the following values:
| -1 or 0 | An error occurred. | |
|
1 |
OK button was pressed. | |
| 2 | Cancel button was pressed. |
Example
The following example launches a New GNS Entry property sheet.
|
Sub Dim iRet iRet= GnsDbEditor.New MsgBox iRet End Sub |